#! /bin/sh
# 
# Laptop mode tools module: Scheduler tunables for multi-socket/multi-core systems.
#

if [ x$CONTROL_SCHED_MC_POWER_SAVINGS = x1 ] ; then
	if [ $ON_AC -eq 1 ]; then
		log "VERBOSE" "On AC power: setting scheduler power saving to 0."
		if [ -w /sys/devices/system/cpu/sched_mc_power_savings ]; then
			echo 0 > /sys/devices/system/cpu/sched_mc_power_savings 
			log "VERBOSE" "Scheduler power save mode disabled."
		else
			log "VERBOSE" "Scheduler power saving is not available."
		fi
	else
		log "VERBOSE" "On battery: setting scheduler power saving to 1."
		if [ -w /sys/devices/system/cpu/sched_mc_power_savings ]; then
			echo 2 > /sys/devices/system/cpu/sched_mc_power_savings 
			log "VERBOSE" "Scheduler power save mode enabled."
		else
			log "VERBOSE" "Scheduler power saving is not available."
		fi

	fi
else
	log "VERBOSE" "Scheduler power setting is disabled."
fi

